#include <iostream>
using namespace std;
void ReplaceBlank(char *string)
{
	int len=strlen(string);
	int blanknum=0;
	char *s1=string;
	while (*s1!='\0')
	{
        if (*s1==' ')
        {
			blanknum++;
        }
		s1++;
	}
	int newlen=len+2*blanknum;
	if (newlen<len)
	return;
	while(len>=0&&len<newlen)
	{
		if (string[len]!=' ')
		{
			string[newlen--]=string[len--];
		}
		else
		{
			string[newlen--]='0';
			string[newlen--]='2';
			string[newlen--]='%';
			len--;
		}
		//--len;
	}

}

int main()
{
	char s[100]="we are happy";
	ReplaceBlank(s);
	cout<<s<<endl;
}